package es.us.lsi.mwm;

public class ClassA {
    
    private int atributo1;
    private int atributo2;
    private String nombre;

    public ClassA(int atributo1, int atributo2, String nombre) {
        super();
        this.atributo1 = atributo1;
        this.atributo2 = atributo2;
        this.nombre = nombre;
    }


    public void setAtributo1(int atributo1) {
        this.atributo1 = atributo1;
    }

    public int getAtributo1() {
        return atributo1;
    }

    public void setAtributo2(int atributo2) {
        this.atributo2 = atributo2;
    }

    public int getAtributo2() {
        return atributo2;
    }
    
    @Override
    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }
        if (!(object instanceof ClassA)) {
            return false;
        }
        final ClassA other = (ClassA) object;
        if (atributo1 != other.atributo1) {
            return false;
        }
        if (atributo2 != other.atributo2) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        final int PRIME = 37;
        int result = 1;
        result = PRIME * result + atributo1;
        result = PRIME * result + atributo2;
        return result;
    }

    public String toString(){
        String res="Nombre: "+nombre+" Atributo1: "+atributo1+" Atributo2: "+atributo2;
        return res;
    }
    
    public int incrementaAtributo1(int incremento){
        atributo1=atributo1*incremento;
        return atributo1;
    }

}
